package programs.expression.implementedClasses;

import programs.expression.superClasses.BinaryBooleanExpression;
import programs.expression.superClasses.Expression;

public class NotEquals extends BinaryBooleanExpression {

	public NotEquals(Expression left, Expression right) {
		super(left, right);
	}

	@Override
	public Object getValue() {
		return (getSubExpressionAt(1).getValue()) != (getSubExpressionAt(2).getValue());
		// of met .equals() ? 
	}
	
	@Override
	public boolean isValidExpression() {
		return ( super.isValidExpression() 
				&& ( getSubExpressionAt(1).getReturnType() == getSubExpressionAt(2).getReturnType() )); 
	}

}
